import Vue from 'vue'
import Router from 'vue-router'
import Login from './views/Login.vue'
import NotFound from './views/404.vue'
import Home from './views/Home.vue'
import Main from './views/Main.vue'
import Menu from './views/permission/Menus'
import Roles from './views/permission/Roles'
import Admin from './views/permission/Admin'
import Info from './views/system/Info'
import Desk from './views/room/Desk'
import GameLog from './views/room/GameLog'
import VipManage from './views/room/VipManage'

Vue.use(Router)

let routes = [
    {
        path: '/login',
        component: Login,
        name: '',
        hidden: true
    },
    {
        path: '/404',
        component: NotFound,
        name: '',
        hidden: true
    },
    //{ path: '/main', component: Main },
    {
        path: '/',
        component: Home,
        name: '数据总览',
        iconCls: 'fa fa-tv',  //图标样式class
        children: [
            { path: '/main', component: Main, name: '主页' },
            { path: '/info', component: Info, name: '配置信息' },
        ]
    },
    {
        path: '/',
        component: Home,
        name: '权限管理',
        iconCls: 'fa fa-key',
        children: [
            { path: '/menus', component: Menu, name: '菜单管理' },
            { path: '/roles', component: Roles, name: '角色管理' },
            { path: '/admins', component: Admin, name: '管理员列表'}
        ]
    },
    {
        path: '/',
        component: Home,
        name: '场地管理',
        children: [
                {
                    path: '/desks',
                    component: Desk,
                    name: '台球卓管理',
                },
                { path: '/desks/gameLog', component: GameLog, name: '记录' },
                { path: '/vipManage', component: VipManage, name: '会员管理' }
            ]
    },
    {
        path: '*',
        hidden: true,
        redirect: { path: '/404' }
    }
];

export default new Router({routes})
